//
//  MICUpLoadFileTool.h
//  PoppoLive
//
//  Created by yanglu on 2020/10/22.
//  Copyright © 2020 PoppoLive. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum : NSUInteger {
    UploadFile_RoomCover,//直播间封面
    UploadFile_MsgPic,//客服聊天图片上传
    UploadFile_PrivatePic,//私照
    UploadFile_PrivateVideo,//私聊视频
    UploadFile_Avatar,//头像
    UploadFile_Auth,//认证图片
    UploadFile_AuthVideo,//认证视频
    UploadFile_MsgAudio,//语音
    UploadFile_VoiceSign,//语音签名
    UploadFile_DynamicPic,//动态图片
    UploadFile_DynamicVideo,//动态视频
    UploadFile_RepairOrder,//工单回复
    UploadFile_Report,//举报图片
    UploadFile_RoomBackground,//语音房背景
    UploadFile_Background,//房间背景
    UploadFile_ChatBackground,//私聊背景
    UploadFile_KefuComment,//客服评价
    UploadFile_MsgVideo,//私Poppo服视频
    UploadFile_TicketVideo,//工单视频
    UploadFile_DatingCover,// 速配封面
    UploadFile_ChatUpImg,// 上传打招呼图片
    UploadFile_Log,//日志
} UploadFileType;


// 上传文件
static NSString * const API_UPLOAD_FILE = @"/upload/file";
//工单上传图片和文件
static NSString * const API_UPLOAD_FILE_TEMP = @"/upload/temp-file";
/// 上次到环信的文件
static NSString * const API_UPLOAD_EM_FILE = @"/api/v2/upload/easemob_file";

@interface BTUpLoadFileTool : NSObject

//上传多图
+ (void)uploadFileWithImage:(NSArray <UIImage *> *)fileArr andUploadType:(UploadFileType)type complete:(void(^)(NSArray<NSString *> *result))complete;
//上传视频
+ (void)uploadVideoWithPath:(NSString *)videoPath andVideoCoverPath:(NSString *)coverPath andUploadType:(UploadFileType)type complete:(void(^)(NSArray<NSString *> *result))complete;
//上传语音
+ (void)uploadAudoWithPaths:(NSArray *)audios andFilePath:(NSString *)filePath andUploadType:(UploadFileType)type complete:(void(^)(NSArray<NSString *> *result))complete;

/// 上传日志文件
/// @param files 日志文件
/// @param completeBlock 成功回调
+ (void)uploadLogsWithLogFiles:(NSArray<NSString *> *)files  completeBlock:(void (^)(NSArray<NSString *> *logFileUrls))completeBlock;


#pragma mark - 上传文件到环信
/// 上传文件到环信
//+ (void)uploadEasemobFileWithData:(NSArray *)dataArr withUploadMMType:(NSArray *)typeArr andPath:(NSArray *)patchArr completionHandler:(void(^)(NSArray *paths))completion failureBlock:(void(^)())failure;

//上传图片到环信
+ (void)uploadEasemobFileWithImage:(NSArray <UIImage *> *)fileArr andUploadType:(UploadFileType)type imgSize:(CGSize)imgSize complete:(void(^)(NSArray *result))complete;
//上传视频到环信
+ (void)uploadEasemobVideoWithPath:(NSString *)videoPath andVideoCoverPath:(NSString *)coverPath andUploadType:(UploadFileType)type complete:(void(^)(NSArray *result))complete;
//上传语音到环信
+ (void)uploadEasemobAudoWithPaths:(NSArray *)audios andFilePath:(NSString *)filePath andUploadType:(UploadFileType)type complete:(void(^)(NSArray *result))complete;

@end

NS_ASSUME_NONNULL_END
